import { service } from '@/utils/request'

/**
 * 获取车辆类型分页数据
 * @param {*} params
 * @returns
 */
export const getCarModelPageApi = (params) => {
  return service({
    url: '/truckType/page',
    params
  })
}

/**
 * 获取车辆类型信息列表
 * @returns
 */
export const getCarModelListApi = () => {
  return service({
    url: '/truckType/simple'
  })
}

/**
 * 添加车辆类型
 * @param {*} data
 * @returns
 */
export const addCarModelApi = (data) => {
  return service({
    url: '/truckType',
    method: 'post',
    data
  })
}

/**
 * 删除车型
 * @param {*} id
 * @returns
 */
export const delCarModelApi = (id) => {
  return service({
    url: `/truckType/${id}`,
    method: 'delete'
  })
}

/**
 * 编辑时回显车型信息
 * @param {*} id
 * @returns
 */
export const getCarModelInfoApi = (id) => {
  return service({
    url: `/truckType/${id}`
  })
}

/**
 * 编辑车型
 * @param {*} id
 * @returns
 */
export const editCarModelApi = (id, data) => {
  return service({
    url: `/truckType/${id}`,
    method: 'put',
    data
  })
}
